package com.base.springboot.starter.web.autoconfigure;

import com.base.springboot.starter.web.config.GlobalExceptionHandler;
import com.base.springboot.starter.web.config.SpringContextUtil;
import com.base.springboot.starter.web.controller.IndexController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 自动配置类
 *
 * @author admin
 * @date 2020/8/21 下午3:48
 */
@Slf4j
@Configuration
@Import({IndexController.class, GlobalExceptionHandler.class})
public class WebAutoConfiguration {
    public WebAutoConfiguration() {
        log.info("Starter WebAutoConfiguration Auto Init ...");
    }

    /**
     * 注入Spring 上下文
     *
     * @return
     */
    @Bean
    public SpringContextUtil setSpringContextUtil() {
        return new SpringContextUtil();
    }
}